<template>
  <div class="rotate-loading">
    <div class="outer">
      <div class="inner"></div>
    </div>
  </div>
</template>
<script setup lang="ts"></script>
<style lang="scss">
.rotate-loading {
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;

  .outer {
    width: 100%;
    height: 100%;
    border-radius: 100%;
    border: 2px solid #ededed;
    display: flex;
    align-items: center;
    justify-content: center;

    .inner {
      flex-shrink: 0;
      width: 50%;
      height: 100%;
      border-radius: 0 50px 50px 0;
      line-height: 100px;
      border: solid var(--primary-color);
      border-width: 2px 2px 2px 0;
      margin-right: -50%;
      animation: ring 1s 100ms infinite;
      animation-timing-function: linear;
      transform-origin: left;
    }
  }
}

@keyframes ring {
  from {
    rotate: 0;
  }

  to {
    rotate: 360deg;
  }
}
</style>
